<include file="Shared:Header" />
<style>
    .tree-node {
        padding: 3px 0px;
    }

    .tabs li a.tabs-inner {
        border-radius: 3px 3px 0 0;
    }

    .panel-title {
        font-size: 9pt;
        height: 23px;
        line-height: 23px;
    }
    .panel-with-icon {
        padding-left: 22px;
    }
    .tree-node {
        border-bottom: 1px solid #ccc;
        height: 29px;
    }

    .tree-node .tree-title {
        line-height: 29px;
        font-size:9pt;
    }

    .tree-node .tree-icon {
        margin-top: 7px;
        padding-right: 5px;
    }

    .tree-node .tree-expanded {
        background: url('__PUBLIC__/Admin/JS/EasyUI/images/accordion_arrows.png') no-repeat 0 0;
    }

    .tree-node .tree-collapsed {
        background: url('__PUBLIC__/Admin/JS/EasyUI/images/accordion_arrows.png') no-repeat -16px 0;
    }

    .tree-node .tree-hit {
        margin-top: 9px;
        float: right;
        margin-right: 6px;
    }

    .tree-node .tree-hit+span {
        margin-left: 16px;
    }
    .viewer-container{
        z-index: 10000000;
    }
</style>
<body class="easyui-layout Father">
<div data-options="region:'north',border:false,minWidth:1000">
    <div class="Top">
        <div class="Logo">
            <img src="__PUBLIC__/Admin/images/H/16.png" alt="CMS" />
        </div>
        <div id="TopRight" class="TopRight">
            <ul id="topnav">
                <li class="list"><a onclick="Replace();"><span class="c1"></span>后台首页</a></li>
               <!--  <li class="list"><a onclick="AddTag('基本信息', '__APP__/System/Basicinfo/index', 'icon279');"><span class="c3"></span>基本信息</a></li> -->
                <li class="list"><a onclick="AddTag('更新缓存', '__APP__/System/Basicinfo/RefreshCache', 'icon289');"><span class="c6"></span>更新缓存</a></li>
                <li class="list"><a onclick="OpenWin('modifypwd');"><span class="c5"></span>修改密码</a></li>
                <li class="list"><a onclick="LoginOut();"><span class="c4"></span>退出系统</a></li>
            </ul>
        </div>
    </div>
</div>
<div data-options="region:'south',border:false,height:'20px',minWidth:1000">
    <div class="bottomBorder">
        <div class="footer" style="float:left; margin-left: 5px;"><span class="shus"></span>
            <span class="shu"></span>
            <span id="TopDate1"></span>
            <span id="TopDate2"></span>
        </div>
        <div class="footer" style="float:right; text-align: right; margin-right:5px;">
            <text>
                <span style="padding:0px 10px;border-right:1px solid #ccc;">Copyright &copy; 2017 - 2019</span>
                <span style="padding:0px 10px;border-right:1px solid #ccc;">当前账号:{$LoginInfo.Admin}</span>
                <span style="padding:0px 10px;border-right:1px solid #ccc;">所属角色:{$LoginInfo.RoleName}<?php?></span>
                <span style="padding:0px 10px;">当前版本Version 1.2.3 [20170919]</span>
            </text>
        </div>
    </div>
</div>
<div data-options="region:'west',collapsible:true,split:true,title:'导航菜单',width:'205px'">
    <div class="easyui-accordion" data-options="fit:true,border:false">
        <volist name="menu_list" id="row">
            <div title='{$row.name}' data-options="iconCls:'{$row.icon}'" style="display:none;">
                <ul class="easyui-tree" data-options="animate:true">
                    <volist name="row.next_menu" id="val" >
                        <if  condition="empty($val['next_menu'])  eq true">
                            <li data-options="iconCls:'{$val.icon}',attributes:{url:'/admin.php/{$val.url}'}"><span>{$val.name}</span></li>
                            <else/>
                            <li data-options="iconCls:'{$val.icon}'"><span>{$val.name}</span>
                                <ul class="easyui-tree" data-options="animate:true,state:'closed'">
                                    <volist name="val.next_menu" id="v" >
                                        <li data-options="iconCls:'{$v.icon}',attributes:{url:'/admin.php/{$v.url}'}"><span>{$v.name}</span></li>
                                    </volist>
                                </ul>
                            </li>
                        </if >
                    </volist>
                </ul>
            </div>
        </volist>
    </div>

</div>
<div data-options="region:'center'">
    <div id="MTabs" data-options="fit:true,tabHeight:32,scrollIncrement:200,border:false" class="easyui-tabs"></div>
</div>
<!--<ul style="width:800px;margin-left: 80px;display: none" class="docs-pictures">-->
<!--<li style="float:left;padding-left:20px;cursor: pointer"><img src="http://localhost:8082/Upload/image/20171213/5a30de55a9e84.png" data-original="{$vo}" style="width:100px;height:100px;"></li>-->
<!--<li style="float:left;padding-left:20px;cursor: pointer"><img src="http://localhost:8082/Upload/image/20171213/5a30e2d7d07c2.png" data-original="{$vo}" style="width:100px;height:100px;"></li>-->
<!--<li style="float:left;padding-left:20px;cursor: pointer"><img src="http://localhost:8082/Upload/image/20180119/5a61aa17e04f4.jpg" data-original="{$vo}" style="width:100px;height:100px;"></li>-->

<!--<volist name="Info['AllPic']" id="vo">-->
<!--<li style="float:left;padding-left:20px;cursor: pointer"><img src="{$vo}" data-original="{$vo}" style="width:100px;height:100px;"></li>-->
<!--</volist>-->
<!--<div class="clear"></div>-->
<!--</ul>-->
<script src="__PUBLIC__/Admin/JS/date.js"></script>
<script>

    function OpenWin(Type) {
        switch (Type) {
            case 'modifypwd':$.XB.open({ 'type':'add','openmode':'0', 'dialog': { 'url': 'admin.php/System/Index/modifypwd/', 'title': '修改密码' } });
                break;

        }}

    $(function () {
        var TopDate = $("#TopDate1");
        showDate(TopDate);
        TopDate = $("#TopDate2");
        setInterval(function () { showTime(TopDate); }, 1000);

        //AddTag("基本信息", "{:U(\'system/basicinfo/index\')}", "icon279");
        var roleid="<?php echo $_SESSION['AdminInfo']['RoleID'];?>";
        if(roleid=='2'){
            //系统管理员
            AddTag("后台首页", "{:U(\'system/basicinfo/home\')}", "icon314");
        }else{
            AddTag("后台首页", "{:U(\'system/basicinfo/home2\')}", "icon314");
        }
        
        $('.easyui-tree').tree({
            onClick: function (node) {
                if (typeof (node.attributes) != "undefined") {
                    AddTag(node.text, node.attributes.url, node.iconCls);
                }
            }
        });

    });





    function AddTag(title, url, icon) {
        if ($("#MTabs").tabs("exists", title)) {
            $('#MTabs').tabs('update', {
                tab: $('#MTabs').tabs('getTab', title),
                options: {
                    content: '<iframe name="iframe" src="' + url + '" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>'
                }
            }).tabs('select', title);
        }
        else {
            $('#MTabs').tabs('add', {
                title: title,
                content: '<iframe name="iframe" src="' + url + '" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>',
                closable: true,
                selected: true,
                iconCls: icon,
                bodyCls: 'NoScroll'
            });
            TagMenu();
        }
    }
    function TagMenu() {
        /*为选项卡绑定右键*/
        $(".tabs li").on('contextmenu', function (e) {
            /*选中当前触发事件的选项卡 */
            var subtitle = $(this).text();
            $('#MTabs').tabs('select', subtitle);
            //显示快捷菜单
            $('#tab_menu').menu('show', {
                left: e.pageX,
                top: e.pageY
            }).menu({
                onClick: function (item) {
                    closeTab(item.id);
                }
            });

            return false;
        });
        $(".tabs-inner").dblclick(function () {
            var subtitle = $(this).children("span").text();
            $('#MTabs').tabs('close', subtitle);
        })
    }
    function closeTab(action) {
        var alltabs = $('#MTabs').tabs('tabs');
        var currentTab = $('#MTabs').tabs('getSelected');
        var allTabtitle = [];
        $.each(alltabs, function (i, n) {
            allTabtitle.push($(n).panel('options').title);
        })
        switch (action) {
            case "refresh":
                var iframe = $(currentTab.panel('options').content);
                var src = iframe.attr("src");
                $('#MTabs').tabs('update', {
                    tab: currentTab,
                    options: {
                        content: '<iframe name="iframe" src="' + src + '" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>'
                    }
                })
                break;
            case "close":
                var currtab_title = currentTab.panel('options').title;
                $('#MTabs').tabs('close', currtab_title);
                break;
            case "closeall":
                $.each(allTabtitle, function (i, n) {
                    $('#MTabs').tabs('close', n);
                });
                break;
            case "closeother":
                var currtab_title = currentTab.panel('options').title;
                $.each(allTabtitle, function (i, n) {
                    if (n != currtab_title) {
                        $('#MTabs').tabs('close', n);
                    }
                });
                break;
            case "closeright":
                var tabIndex = $('#MTabs').tabs('getTabIndex', currentTab);
                $.each(allTabtitle, function (i, n) {
                    if (i > tabIndex) {
                        $('#MTabs').tabs('close', n);
                    }
                });
                break;
            case "closeleft":
                var tabIndex = $('#MTabs').tabs('getTabIndex', currentTab);
                $.each(allTabtitle, function (i, n) {
                    if (i < tabIndex) {
                        $('#MTabs').tabs('close', n);
                    }
                });
                break;
            case "exit":
                $('#tab_menu').menu('hide');
                break;
        }
    }
    function LoginOut() {
        $.post("{:U('System/Login/logout')}", function (data) {
            if (data.result) {
                top.location.href = data.des;
            }
        }, "json");
    }


    function bigPopup(num) {
        var $images = $('.docs-pictures');
        $images.viewer("view", num);
    }

</script>
<div id="tab_menu" class="easyui-menu" style="width: 150px;display:none;">
    <div id="refresh">刷新标签</div>
    <div class="menu-sep"></div>
    <div id="close">关闭标签</div>
    <div id="closeall">全部关闭</div>
    <div id="closeother">关闭其他</div>
    <div class="menu-sep"></div>
    <div id="closeright">关闭右边</div>
    <div id="closeleft">关闭左边</div>
    <div class="menu-sep"></div>
    <div id="exit">退出菜单</div>
</div>
</body>
<include file="Shared:Footer" />